package cmsenum

/*
@Time : 2023/1/31 17:27
@Author : licxpro
@File : cms.enum.go
*/

type DetailStatus int

const (
	Draft     DetailStatus = 0
	Published DetailStatus = 1
	Checking  DetailStatus = 2
	Checked   DetailStatus = 3
	Deny      DetailStatus = 4
	Unknown   DetailStatus = 999
)

func New(code int) DetailStatus {
	return DetailStatus(code)

}

var ListStatusMap = map[DetailStatus]string{
	Draft:     "新建",
	Published: "已发",
	Checking:  "审核中",
	Checked:   "审核通过",
	Deny:      "否定",
	Unknown:   "未知",
}

func (p DetailStatus) StringStatus() string {
	if v, ok := ListStatusMap[p]; ok {
		return v
	}
	return "空"
}
